package com.itheima.mm.dao;

import com.itheima.mm.entity.QueryPageBean;
import com.itheima.mm.pojo.Question;
import com.itheima.mm.pojo.QuestionItem;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuestionDao {
    /*直接去问题库里根据返回*/
    List<Question> findListByPage(@Param("queryPageBean") QueryPageBean queryPageBean);
    /*根据id获取该usedQty*/
    int findUsedQtyById(@Param("id") int id);
    /*获取题目的总数*/
    Long findTotal(@Param("queryPageBean")QueryPageBean queryPageBean);
    List<Question> findClassicListByPage(@Param("queryPageBean")QueryPageBean queryPageBean);
    Question findById(@Param("id") Integer id);
    List<QuestionItem> findQuestionItemListByQuestionId(@Param("id") Integer id);

    Integer findIsIsFavorite(@Param("userId") Integer userId, @Param("questionId")Integer questionId);

    String findAnswerResult(@Param("userId")Integer userId, @Param("questionId")Integer questionId);

    void add(Question question);

    void addQuestionItem(@Param("question") Question question);

    void addTagQues(@Param("question")Question question);

    Integer getMaxID();

    void update(Question question);

    void delectQuestionItemByQuestionID(Question question);

    void delectTagQuesByQuestionID(Question question);

    void updateClassic(@Param("id") Integer questionId);

    Integer findQuestionQty(@Param("courseId") Integer courseId);

    Integer findQuestionQtyByCatalogId(@Param("catalogId") Integer catalogId);

    Integer findQuestionQtyByTypeId(@Param("tagId") Integer id);
}
